-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new resource google_compute_target_ssl_proxy #569
Conversation
return nil | ||
} | ||
|
||
func expandSslCertificates(configured []interface{}, d *schema.ResourceData, config *Config) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function would be a bit simpler if it didn't take the configured
parameter (which is of a very confusing type). Instead you can use the d
parameter to extract out the ssl_certificates
field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
d.Partial(true) | ||
|
||
if d.HasChange("proxy_header") { | ||
proxy_header := d.Get("proxy_header").(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to be that guy but this is using snake case rather than camel case.
It's totally readable to me but I imagine others might find it bad style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oupps, I let this one slip. Good catch!
|
||
if d.HasChange("proxy_header") { | ||
proxy_header := d.Get("proxy_header").(string) | ||
proxy_header_payload := &compute.TargetSslProxiesSetProxyHeaderRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if found.Name != rs.Primary.ID { | ||
return fmt.Errorf("TargetSslProxy not found") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do more testing here (e.g. that the stored parameters match the set parameters)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
foundCertsName = append(foundCertsName, GetResourceNameFromSelfLink(foundCert)) | ||
} | ||
|
||
if !reflect.DeepEqual(foundCertsName, sslCerts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does order matter? If it doesn't, you might consider sorting or something before doing the deepEqual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, after waiting for the full test run to finish and reading the API docs, one and only one certificate must be specified at this time (they might support more in the future). So I added a MaxItems:1
on the schema for now and simplified this check.
From the docs:
"Currently exactly one SslCertificate resource must be specified."
* Add target ssl proxy * Add documentation
* Add target ssl proxy * Add documentation
<!-- This change is generated by MagicModules. --> /cc @rileykarson
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fixes #62